		

		// 初始化基本js信息
		
		var $all = $('body,html');
		
		var h = $(window).height();

		var bh =h/2+"px";
		
		var $mcover = $("#mcover");
		
		var $content = $("#content");
		
		$mcover.height(h+"px");
		
		$content.height(h+"px");
		
		
		//花瓣加载效果
        var opts = {            
            lines: 10, // 花瓣数目
            length: 5, // 花瓣长度
            width: 3, // 花瓣宽度
            radius: 5, // 花瓣距中心半径
            corners: 1, // 花瓣圆滑度 (0-1)
            rotate: 0, // 花瓣旋转角度
            direction: 1, // 花瓣旋转方向 1: 顺时针, -1: 逆时针
            color: 'black', // 花瓣颜色
            speed: 1, // 花瓣旋转速度
            trail: 60, // 花瓣旋转时的拖影(百分比)
            shadow: false, // 花瓣是否显示阴影
            hwaccel: false, //spinner 是否启用硬件加速及高速旋转            
            className: 'spinner', // spinner css 样式名称
            zIndex: 2e9, // spinner的z轴 (默认是2000000000)
            top: bh, // spinner 相对父容器Top定位 单位 px
            left: '50%'// spinner 相对父容器Left定位 单位 px
        };

        var spinner = new Spinner(opts);
		var target = document.getElementById('spin');
		
		
		//显示加载效果
		function showSpin()
		{
			
			
			spinner.spin(target);
			//.show();
		}
		
		
		//隐藏加载效果
		function hideSpin()
		{
			spinner.spin();
			//$mcover.hide();
		}
		
		
		
		//页面切换成功回调
		function routeChangeSuccess(event) {  
			
			
			
			
	    } 
		
		
		var loading = document.querySelector('#loading');
		var showMsg = document.querySelector('#msg');
		// loadming提示
		function showMsg(msg)
		{
			showMsg.html(msg);
			loading.style.display = 'block';
			setTimeout(function(){
				loading.style.display = 'none';
			},1500);
		}
		
		
		// 恢复底部菜单以及右下方菜单初始状态
		
		var submenu = $('.sub-menu');
		var imore = $('.icon-more');
		var ileft = $('.icon-left');
	
		var ihidden = $('.icon-hidden');
		var icart = $('.icon-cart');
		var ihome = $('.icon-home');
		var ishop = $('.icon-shop');
		var imap = $('.map-left');
		
		function defaultMenu()
		{
			
			
		
			setTimeout("$all.animate({scrollTop:0},1000)",1000);
			//$all.animate({scrollTop:0},1000); 
			submenu.removeClass('active').css({bottom:'-500px',opacity:'0'});
			
			
			ileft.show();
			imap.show();
			imore.removeClass('active');
			ihidden.css({zIndex:'-1',opacity:'0'});
			imore.css({background:'url("images/icon-more.png") no-repeat center center black',backgroundSize:'23px 6px'});
			ihome.css('webkitTransform','translate3d(0,0,0)');
			icart.css('webkitTransform','translate3d(0,0,0)');
			ishop.css('webkitTransform','translate3d(0,0,0)');
			//imap.css('webkitTransform','translate3d(0,0,0)');
		}
		
		
		var tabview = $("#tabview");
		
		var circle = $("#circle-icon");
		
		var mmap = $("#map-icon");
		//底部菜单
		function bottomMenu()
		{
			defaultMenu();
			tabview.show();
			circle.hide();
			mmap.hide();
		}
		
		
		//右下角菜单
		function rightMenu()
		{
			defaultMenu();
			tabview.hide();
			mmap.hide();
			circle.show();
//			$(".circle-left").show();
		}
		
		//店面列表菜单
		function mapMenu()
		{
			defaultMenu();
			tabview.hide();
			mmap.show();
			circle.hide();
//			$(".circle-left").show();
		}
		
		//隐藏菜单
		function hideMenu()
		{
			tabview.hide();
			circle.hide();
			mmap.hide();
//			$(".circle-left").show();
		}
		
			//右下方悬浮菜单
			imore.click(function(event) {
			
				ileft.toggle();
				imap.toggle();
				$(this).toggleClass('active');
				if($(this).hasClass('active')){
					ihidden.css({zIndex:'997',opacity:'1'});
					imore.css({background:'url("images/icon-del.png") no-repeat center center black',backgroundSize:'20px 20px'});
					ihome.css('webkitTransform','translate3d(7px,-56px,0)');
					ishop.css('webkitTransform','translate3d(-42px,-39px,0)');
					//imap.css('webkitTransform','translate3d(-51px,11px,0)');
					icart.css('webkitTransform','translate3d(-51px,11px,0)');
				}
				else{
					ihidden.css({zIndex:'-1',opacity:'0'});
					imore.css({background:'url("images/icon-more.png") no-repeat center center black',backgroundSize:'23px 6px'});
					ihome.css('webkitTransform','translate3d(0,0,0)');
					icart.css('webkitTransform','translate3d(0,0,0)');
					ishop.css('webkitTransform','translate3d(0,0,0)');
					//imap.css('webkitTransform','translate3d(0,0,0)');
				}
			});
			
			//var overlay = $('#content');
			//底部菜单
			var fmenu = $('div.fmenu');
			fmenu.on('click',function(event) {
				
				var $subMenu=$(this).find('.sub-menu');
				//overlay.fadeToggle('fast');
				if($subMenu){
					
					$(this).siblings().find('.sub-menu').removeClass('active').css({bottom:'-500px',opacity:'0'});
					if($subMenu.hasClass('active')){
						$subMenu.removeClass('active').css({bottom:'-500px',opacity:'0'});
					}
					else{
						
						$subMenu.addClass('active').css({bottom:'53px',opacity:'1'});
					}
				}
			});
		
			function retSetMenu(){
				
				fmenu.siblings().find('.sub-menu').removeClass('active').css({bottom:'-500px',opacity:'0'});
				}
			
			
			//轮播resize
			 function initBox()
			 {
				
				
				  var swiper = new Swiper('.swiper-container', {
		        pagination: '.swiper-pagination',
		       
		        slidesPerView: 1,
		        paginationClickable: true,
		        spaceBetween: 30,
				autoplay:2000

		    });
				  

			 }
			
			
			 
			 function initHtmlImg()
			 {
				 
				 $(".img-full img").css({'width':'100%'});
			 }
			 	
			 
			 
				function configWx(res)
				{
					//alert(res.result.rawString);
					//alert(res.result.url);
					wx.config({
			 		    debug: true, 
			 		   appId: res.result.appId,
			 				timestamp: res.result.timestamp,
			 				nonceStr: res.result.nonceStr,
			 				signature: res.result.signature,
			 		    jsApiList: [
			 		      // 所有要调用的 API 都要加到这个列表中
			 		      'onMenuShareTimeline',
			 		      'onMenuShareAppMessage',
			 		      'chooseImage',
						  'previewImage',
						  'uploadImage'
			 		    ]
			 		  });
					
					 
				}
				